<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class StoreBasic extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'company' => 'required|max:50',
            'true_name' => 'required|max:50',
            'true_name_look' => 'in:1,2',
            'mobile' => 'required|max:20',
            'birth' => 'required|max:20',
            'province' => 'max:20',
            'city' => 'max:20',
            'area' => 'max:20',
            'start_work_time' => 'required|max:20',
            'annual_salary' => 'required|max:30',
            'is_look_annual_salary' => 'in:0,1',
            'now_status' => 'required|max:50',
        ];
    }

    public function messages()
    {
        return [
            'company.required' => '请输入职位名称',
            'company.max' => '职位名称过长',
            'true_name.required' => '请输入姓名',
            'true_name.max' => '姓名过长',
            'true_name_look.in' => '显示称谓参数错误',
            'mobile.required' => '请输入手机号码',
            'mobile.max' => '手机号码长度过长',
            'birth.required' => '请选择出生日期',
            'birth.max' => '选择出生日期出错',
            'province.max' => '当前所在地址出错',
            'city.max' => '当前所在地址出错',
            'area.max' => '当前所在地址出错',
            'start_work_time.required' => '请选择开始工作年份',
            'start_work_time.max' => '开始工作年份出错',
            'annual_salary.required' => '请选择当前年薪',
            'annual_salary.max' => '当前年薪错误',
            'is_look_annual_salary.in' => '当前年薪显示状态错误',
            'now_status.required' => '请选择目前状态',
            'now_status.max' => '目前状态出错',
        ];
    }
}
